//
//  NSMutableDictionary+Publicdic.m
//  DTSTON
//
//  Created by 喻贵华 on 16/5/5.
//  Copyright © 2016年 Demo. All rights reserved.
//

#import "NSMutableDictionary+Publicdic.h"

@implementation NSMutableDictionary (Publicdic)
+(NSMutableDictionary*)getPubdic
{
    long long timestamp = time(NULL);
    NSString *time = [NSString stringWithFormat:@"%lld",timestamp ];
    
    NSDictionary *info=[[NSBundle mainBundle] infoDictionary];
    NSLog(@"%@,%@",EXRACT_OBJECT(DTUID),EXRACT_OBJECT(TOKEN));
    if (EXRACT_OBJECT(DTUID) == nil) {
        return nil;
    }
    NSDictionary *dic=@{@"productId":DTCloudKitAppId,
                        @"mac":[UIDevice currentDevice].identifierForVendor.UUIDString,
                        @"platform":@"2",
                        @"rtime":time,
                        @"version":info[@"CFBundleShortVersionString"],
                        @"uid":EXRACT_OBJECT(DTUID),
                        @"token":EXRACT_OBJECT(TOKEN)
                        };
    return [NSMutableDictionary dictionaryWithDictionary:dic];

  
}
+(NSMutableDictionary*)getPubdicGuest
{
    long long timestamp = time(NULL);
    NSString *time = [NSString stringWithFormat:@"%lld",timestamp];
    
    NSDictionary *info=[[NSBundle mainBundle] infoDictionary];
    NSDictionary *dic=@{@"productId":DTCloudKitAppId,
                        @"mac":MAC,
                        @"version":info[@"CFBundleShortVersionString"],
                        @"rtime":time,
                        @"platform":@"2"
                        };
    return [NSMutableDictionary dictionaryWithDictionary:dic];
}
@end
